#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <stack>
#include <queue>
using namespace std;

void test1()
{
	stack<int> s;
	s.push(1);
	s.push(2);
	s.push(3);
	s.push(4);
	while (!s.empty())
	{
		cout << s.top() << " ";
		s.pop();
	}cout << endl;

	queue<int> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);
	while (!q.empty())
	{
		cout << q.front() << " ";
		q.pop();
	}
	cout << endl;

	priority_queue<int> p;
	p.push(1);
	p.push(4);
	p.push(5);
	p.push(2);
	p.push(3);
	while(!p.empty())
	{
		cout << p.top() << " ";
		p.pop();
	}
	cout << endl;
}

class Less
{
public:
	bool operator()(int x, int y)
	{
		return x < y;
	}
};

void test2()
{
	Less less;

	cout << less(2, 3) << endl;

	cout << less.operator()(2, 3) << endl;
}

void test3()
{
	vector<int> v{ 3,9,6,4,1,5,10,15,13,11 };
	priority_queue<int> q1;
	for (auto x : v)
		q1.push(x);
	while (!q1.empty())
	{
		cout << q1.top() << " ";
		q1.pop();
	}
	cout << endl;

	priority_queue<int, vector<int>, greater<int>> q2(v.begin(), v.end());
	while (!q2.empty())
	{
		cout << q2.top() << " ";
		q2.pop();
	}
	cout << endl;
	
}


int main()
{
	//test1();
	//test2();
	test3();
	return 0;
}

